<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/includes.jsp" %>

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>更新菜单|OneThink管理平台</title>
    <link href="${ctx}/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="${ctx}/admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/admin/css/style.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/admin/css/default_color.css" media="all">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${ctx}/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="${ctx}/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="${ctx}/admin/js/jquery.mousewheel.js"></script>
    <!--<![endif]-->

</head>
<body>
<!-- 头部 -->
<div class="header">
    <!-- Logo -->
    <span class="logo"></span>
    <!-- /Logo -->

    <!-- 主导航 -->
    <ul class="main-nav">
        <li class=""><a href="/ot1/admin.php?s=/Index/index.html">首页</a></li><li class=""><a href="/ot1/admin.php?s=/Article/index.html">内容</a></li><li class=""><a href="/ot1/admin.php?s=/User/index.html">用户</a></li><li class="current"><a href="/ot1/admin.php?s=/Config/group.html">系统</a></li><li class=""><a href="/ot1/admin.php?s=/Addons/index.html">扩展</a></li>        </ul>
    <!-- /主导航 -->

    <!-- 用户栏 -->
    <div class="user-bar">
        <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
        <ul class="nav-list user-menu hidden">
            <li class="manager">你好，<em title="Administrator">Administrator</em></li>
            <li><a href="/ot1/admin.php?s=/User/updatePassword.html">修改密码</a></li>
            <li><a href="/ot1/admin.php?s=/User/updateNickname.html">修改昵称</a></li>
            <li><a href="/ot1/admin.php?s=/Public/logout.html">退出</a></li>
        </ul>
    </div>
</div>
<!-- /头部 -->

<!-- 边栏 -->
<div class="sidebar">
    <!-- 子导航 -->

    <div id="subnav" class="subnav">
        <!-- 子导航 -->
        <h3><i class="icon icon-unfold"></i>系统设置</h3>                        <ul class="side-sub-menu">
        <li>
            <a class="item" href="/ot1/admin.php?s=/Config/group.html">网站设置</a>
        </li><li>
        <a class="item" href="${ctx}/admin/partstype/add.shtml">分类管理</a>
    </li><li>
        <a class="item" href="/ot1/admin.php?s=/Model/index.html">模型管理</a>
    </li><li>
        <a class="item" href="/ot1/admin.php?s=/Config/index.html">配置管理</a>
    </li><li>
        <a class="item" href="/ot1/admin.php?s=/Menu/index.html">菜单管理</a>
    </li><li>
        <a class="item" href="/ot1/admin.php?s=/Channel/index.html">导航管理</a>
    </li>                        </ul>                    <!-- /子导航 --><!-- 子导航 -->
        <h3><i class="icon icon-unfold"></i>数据备份</h3>                        <ul class="side-sub-menu">
        <li>
            <a class="item" href="/ot1/admin.php?s=/Database/index/type/export.html">备份数据库</a>
        </li><li>
        <a class="item" href="/ot1/admin.php?s=/Database/index/type/import.html">还原数据库</a>
    </li>                        </ul>                    <!-- /子导航 -->            </div>

    <!-- /子导航 -->
</div>
<!-- /边栏 -->

<!-- 内容区 -->
<div id="main-content">
    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
        <button class="close fixed" style="margin-top: 4px;">&times;</button>
        <div class="alert-content">这是内容</div>
    </div>
    <div id="main" class="main">

        <!-- nav -->
        <!-- nav -->
        <div class="main-title">
            <c:choose>
                <c:when test="${(empty pInfo && not empty info) || (empty info)}">
                    <h2>新增类型</h2>
                </c:when>
                <c:when test="${(not empty info && info.fId == 0)}">
                    <h2>更新类型</h2>
                </c:when>
                <c:otherwise>
                    <h2>更新类型</h2>
                </c:otherwise>
            </c:choose>
        </div>
        <form action="${ctx}/admin/partstype/edit.shtml" method="post" class="form-horizontal">
            <div class="form-item">
                <label class="item-label">上级分类<span class="check-tips">（父类型）</span></label>
                <div class="controls">
                    <c:if test="${empty pInfo}">
                        <input type="hidden" class="text input-large" name="fId" value="0">
                        <input type="text" class="text input-large" value="无" disabled="disabled">
                    </c:if>
                    <c:if test="${not empty pInfo}">
                        <input type="hidden" class="text input-large" name="fId" value="${pInfo.id}">
                        <input type="text" class="text input-large" value="${pInfo.typeName}" disabled="disabled">
                    </c:if>
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">类型代码</label>
                <div class="controls">
                    <input type="text" class="text input-small" name="typeCode" value="${info.typeCode}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">类型名称</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="typeName" value="${info.typeName}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">类型名称<span class="check-tips">（英文）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large" name="typeNameEn" value="${info.typeNameEn}">
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">排序</label>
                <div class="controls">
                    <input type="text" class="text input-large" name="sort" value="${info.sort}">
                </div>
            </div>
            <div class="form-item">
                <input type="hidden" name="id" value="${info.id}">
                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
        </form>

    </div>
    <div class="cont-ft">
        <div class="copyright">
            <div class="fl">感谢使用管理平台</div>
            <div class="fr">V1.1.141101</div>
        </div>
    </div>
</div>
<!-- /内容区 -->

<script type="text/javascript" src="${ctx}/static/think.js"></script>
<script type="text/javascript" src="${ctx}/admin/js/common.js"></script>
<script type="text/javascript">
    +function(){
        var $window = $(window), $subnav = $("#subnav"), url;
        $window.resize(function(){
            $("#main").css("min-height", $window.height() - 130);
        }).resize();

        /* 左边菜单高亮 */
        url = window.location.pathname + window.location.search;
        url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
        $subnav.find("a[href='" + url + "']").parent().addClass("current");

        /* 左边菜单显示收起 */
        $("#subnav").on("click", "h3", function(){
            var $this = $(this);
            $this.find(".icon").toggleClass("icon-fold");
            $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
            prev("h3").find("i").addClass("icon-fold").end().end().hide();
        });

        $("#subnav h3 a").click(function(e){e.stopPropagation()});

        /* 头部管理员菜单 */
        $(".user-bar").mouseenter(function(){
            var userMenu = $(this).children(".user-menu ");
            userMenu.removeClass("hidden");
            clearTimeout(userMenu.data("timeout"));
        }).mouseleave(function(){
            var userMenu = $(this).children(".user-menu");
            userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
            userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
        });

        /* 表单获取焦点变色 */
        $("form").on("focus", "input", function(){
            $(this).addClass('focus');
        }).on("blur","input",function(){
            $(this).removeClass('focus');
        });
        $("form").on("focus", "textarea", function(){
            $(this).closest('label').addClass('focus');
        }).on("blur","textarea",function(){
            $(this).closest('label').removeClass('focus');
        });

        // 导航栏超出窗口高度后的模拟滚动条
        var sHeight = $(".sidebar").height();
        var subHeight  = $(".subnav").height();
        var diff = subHeight - sHeight; //250
        var sub = $(".subnav");
        if(diff > 0){
            $(window).mousewheel(function(event, delta){
                if(delta>0){
                    if(parseInt(sub.css('marginTop'))>-10){
                        sub.css('marginTop','0px');
                    }else{
                        sub.css('marginTop','+='+10);
                    }
                }else{
                    if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                        sub.css('marginTop','-'+(diff-10));
                    }else{
                        sub.css('marginTop','-='+10);
                    }
                }
            });
        }
    }();
</script>

<script type="text/javascript">
    //导航高亮
    highlight_subnav('/ot1/admin.php?s=/Menu/index.html');
</script>

</body>
</html>